let a:number=1;
console.log(a);

let b:string='bbb';
console.log(b);

let c:boolean=true;
console.log(c);

function d(a:number,b?:number):number{
    return a=a;
}
console.log(d(1,2))

let e=(a:string,b:string):string=>{
    return a+b
}
console.log(e('a','b'))

let arr:Array<number>=[1,2];
console.log(arr);

let arr1:string[]=['1','2'];
console.log(arr1);

let arr2:(string|number)[]=[1,'2']
console.log(arr2);

let arr3:[number,string,boolean]=[1,'2',true];
console.log(arr3);

let json:{name:string,age:number,sex?:string}={name:'你',age:18,sex:'男'}
console.log(json.name+' '+json.age+' '+' '+json.sex);

let arr4:{name:string,age:number,sex?:string}[]=[{name:'你',age:18,sex:'男'}]
console.log(arr4)

let josn1:{name:string,age:number,hobby:string[]}={name:'aaa',age:12,hobby:['篮球','足球']}
console.log(josn1)
//json对象里面必须要有x1，x2其余随便。 或者所有都随便，但是对应的值必须是string
let json2:{x1:string,x2:number,[propName:string]:any}={x1:'aaa',x2:12,x3:123};
console.log(json2);

let json3:{[propName:string]:number}={AAA:123,12:12,};
console.log(json3);

let arr5:{name:string,age?:number}[]=[{name:'123',age:18}];
console.log(arr5[0])





